<%@page import="team3.jobportal.controller.ApplicationController"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Job Portal</title>
<style type="text/css">
	#verticalcentre { position:absolute; top:40%; left:28%; height:10em; margin-top:-5em}
</style>
</head>
<body background="images\green_white_circles.jpg">
<jsp:useBean id="student" class="team3.jobportal.businesslogic.Student" scope="application"></jsp:useBean>
<jsp:setProperty name="student" property="userName" value="<%=request.getParameter(\"studentUserName\") %>" />
<jsp:setProperty name="student" property="password" value="<%=request.getParameter(\"studentPassword\") %>" />
    			

<% if(ApplicationController.getStatus()==(team3.jobportal.utilities.Status.lastAction.studentAccountCreated)){%>
 <script type="text/javascript">
	   alert("Successfully created Student Account. Please login..");
	   </script>
<%}%>
	<div id="verticalcentre">
	<table border="0">
	<tr>
	<td>
	<form method="post" action="">
	
	<div align="center"> Welcome student !!</div>
						<br/>
						
						
		Username   <input name="studentUserName" />
		
		<br/> 
    	Password   <input type="password" name="studentPassword"> <br/> 
    
    <div align="center"> <input type="submit" name="StudentLogin" value="Login">
    <br/><br/> 
     <a href="StudentRegistration.jsp">New Students - Register Here!!</a>
     </div>
	</form>

	</td>
	
	
	</tr>
	</table>
	</div>
	<%
	if((ApplicationController.getController().isStudentLoginValid(student)) && (student.getUserName()!=null))
	{ %>
	 <jsp:forward page="StudentActions.jsp"></jsp:forward>
	<%
	}else
	 {
	  if(student.getUserName()!=null)
	  {
	  %>
	   <script type="text/javascript">
	   alert("Invalid Username/Password.");
	   </script>
	 <% }}
	 %>
	 
	
</body>
</html>